package com.dubbo;

import com.dubbo.Provider.Interface.DemoService;
import com.dubbo.bean.User;
import org.apache.log4j.Logger;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

/**
 * Created by thinkjoy on 2017/6/30.
 */
public class consumerApplication {
    private static final Logger LOG= Logger.getLogger(consumerApplication.class);

    public static void main(String[] args) {
        ClassPathXmlApplicationContext context=new ClassPathXmlApplicationContext("classpath:spring/spring-consumer.xml");
        context.start();
        DemoService demoService= (DemoService) context.getBean("demoService");
        String hello=demoService.sayHello("许伟杰");
        System.out.println(hello);
        List list=demoService.getUsers();
        for (Object u:list) {
            User user= (User) u;
            System.out.println(user.toString());
        }
    }

}
